<template>
    <!-- components/custom-nav/index.wxml -->
    <view :style="'padding-top: ' + pTop">
        <view class="iconft icon-31fanhui1">111</view>
    </view>
</template>

<script>
// components/custom-nav/index.js
export default {
    data() {
        return {
            statusBarHeight: 0,
            pTop: ''
        };
    },
    /**
     * 组件的属性列表
     */
    props: {},
    mounted() {
        // 处理小程序 attached 生命周期
        this.attached();
    },
    methods: {
        attached() {
            // console.log('组件显示了');
            uni.getSystemInfo({
                success: (res) => {
                    console.log(res);
                    this.setData({
                        pTop: res.statusBarHeight
                    });
                }
            });
        }
    },
    created: function () {}
};
</script>
<style>
/* components/custom-nav/index.wxss */
</style>
